//
//  MeiController.m
//  MyProject
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 蓝鸥0825. All rights reserved.
//

#import "MeiController.h"
#import "WHZAfnetWorking.h"
#import "MeiModel.h"

#import "MeiFsecController.h"

#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height

@interface MeiController ()

@end

@implementation MeiController

- (void)viewDidLoad {
    
    [super viewDidLoad];
   
    //      cell 的赋值一定要在tableView 中写, 在别的地方写没发传值
    self.view1 = [[MeiView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:self.view1];
    self.view1.VC = self;
    [self.view1 release];
    
    
    self.hud = [[MBProgressHUD alloc] initWithFrame:CGRectMake(WIDTH / 100 * 40, HEIGHT / 100 * 45, WIDTH / 100 * 5, HEIGHT / 100 * 5)];
    [self.view addSubview:self.hud];
    [self.hud show:YES];
    
    
    [self createData];
    
    }



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



    
- (void)createData{
    
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.xiachufang.com/v2/issues/list.json?cursor=&origin=iphone&api_sign=02d5ed8c6f0bc04b84692cad23c3b858&size=2&timezone=Asia%2FShanghai&version=5.0.1&api_key=0f9f79be1dac5f003e7de6f876b17c00" WithParameters:nil Block:^(id result) {
        
        NSDictionary *dic = result;
        self.arrayFirst = [NSMutableArray array];
        self.arrayFirst = [MeiModel baseModelByArr:dic[@"content"][@"issues"]];
        self.view1.array = self.arrayFirst;
        [self.view1.table reloadData];
        [self.hud hide:YES];
    }];

}












@end
